# -*- coding: utf-8 -*-

# Created on 07/08/2010

# Copyright (C) 2010  Sergio Rodrigo

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.


class Actor:
    """ Logic of the game actors.
    
    * Methods:
    __init__(self, x=0, y=0, actorGraphic=None)
    update(self)
    _updateLogic(self)
    executeAction(self, action)
    
    * Member variables:
    x -- Integer x position
    y -- Integer y position
    actorGraphic -- ActorGraphic object
    team -- Team object
    
    Must be subclassed.
    
    """

    def __init__(self, x=0, y=0, actorGraphic=None, team=None):
        """ Constructor.
        
        * Arguments:
        x -- Integer x position (default 0)
        y -- Integer y position (default 0)
        actorGraphic -- ActorGraphic object (default None)
        team -- Team object (default None)
        scores -- Score list
        
        """
        self.x = x
        self.y = y
        self.actorGraphic = actorGraphic
        self.team = team
        self.scores = []

    def update(self):
        """ Update the actor.
        
        """
        self._updateLogic()

    def _updateLogic(self):
        """ Update the logic of actor.
        
        Should be overriden if the subclass is a non controllable actor.
        
        """
        pass

    def executeAction(self, action):
        """ Executes an action.
        
        * Arguments:
        action -- Action object
        
        Must be overriden.
        
        """
        raise NotImplementedError

# eof
